﻿
namespace SRTSolutions.Elevate.FuncExtensions
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    /// <summary>
    /// Extension methods related to conditional execution.
    /// </summary>
    public static class ConditionalExtensions
    {
        /// <summary>
        /// Execute the action if condition is true.
        /// </summary>
        /// <param name="action"></param>
        /// <param name="condition"></param>
        /// <example>Run.If(1==x);</example>
        public static void If(this Action action, bool condition)
        {
            if (condition)
                action();
        }
    }
}
